#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<assert.h>
int lengthOfLongestSubstring(char* s)
{
    assert(s);
    char* start = s;
    int count = 0;
    int tmp = 0;
    int i = 0;
    while (*s)
    {
        for (i = 0; i < s - start; i++)
        {
            if (*s == *(start + i))
            {
                if (count > tmp)
                {
                    tmp = count;
                }
                s = start + i + 1;
                start = s;
                count = 0;
                break;
            }
        }
        s++;
        count++;
    }
    return tmp > count ? tmp : count;
}
int main()
{
    char string[100] ="abcabcd";
    int len=lengthOfLongestSubstring(string);
    printf("%d", len);
    return 0;
}